import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:kq_flutter_core_widget/utils/ex/kq_ex.dart';
import 'package:kq_flutter_widgets/widgets/animate/mapChart/map_chart.dart';
import 'package:kq_flutter_core_widget/widgets/image/kq_image.dart';
import 'package:kq_flutter_widgets/widgets/titleBar/kq_title_bar.dart';

import '../../resources/Images.dart';

class MapChartDemo extends StatefulWidget {
  const MapChartDemo({super.key});

  @override
  State<StatefulWidget> createState() => MapChartDemoState();
}

class MapChartDemoState extends State<MapChartDemo> {
  /*MapChartData data = MapChartData(
    starts: const [
      Point<double>(0, 0),
      Point<double>(300, 10),
      Point<double>(10, 400),
      Point<double>(300, 400),
    ],
    end: const Point<double>(200, 200),
    pLine: Paint()..color = Colors.red..style=PaintingStyle.stroke,
    pStart: Paint()..color = Colors.blueAccent,
    pEnd: Paint()..color = Colors.cyan,
    pCur: Paint()..color = Colors.amberAccent,
  );*/

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: KqHeadBar(
        headTitle: 'MapChart控件动画演示',
        back: () {
          Get.back();
        },
      ),
      body: Stack(
        children: [
          KqImage.assets(
            url: Images.demoWorld6,
            fit: BoxFit.contain,
          ),
          MapChart(data: Get.getArgOrParams<MapChartData>("data")!),
        ],
      ),
    );
  }
}
